<!DOCTYPE html>
<!-- 
主题：base 
作用于：用户主页
 -->
<html lang="cmn-Hans-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>{{ config['blog_name'] }}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/static/picture/icon.png" type="image/x-icon">
    <link rel="stylesheet" href="/static/css/base/base.css">
</head>
<script>
    var CONFIG = {{ config | safe }};
</script>
{% raw %}

<body>
    <!-- Vue 实例容器 -->
    <div id="app">
        <router-view></router-view>
    </div>
    <!-- 加载 Vue 和 Vue-router-->
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue-router/dist/vue-router.js"></script>
    <!-- Vue 组件模板 -->
    <template id="template-index-nav">
        <div class="nav">
            <ul class="nav-items">
                <li v-for="n in nav_data" v-bind:class="{ 'nav-item':!n.active ,'nav-item-active':n.active}">
                    <router-link v-bind:to="n.target">
                        {{ n.name }}
                    </router-link>
                </li>
            </ul>
            <div class="nav-icon">
                <img v-bind:src="icon_url">
            </div>
        </div>
    </template>
    <template id="template-index">
        <div>
            <index-nav></index-nav>
            <div id="main">
                <div class="relative-area">
                    <ul class="articles">
                        <span v-if="!articles" class="wating">Loading......</span>
                        <li v-if="articles" v-for="a in articles" class="article">
                            <a class="a-title" v-bind:href="'/b/'+ blog_info['username'] +'#/article/'+a[0]">
                                {{ a[1] }} 
                            </a>
                            <p class="a-brief">{{ a[2] }}</p>
                        </li>
                    </ul>
                </div>
            </div>
        </div>

    </template>
    <template id="template-article">
        <div>
            <index-nav></index-nav>
            <div id="main">
                <div class="relative-area">
                    <ul class="articles">
                        <span v-if="!article" class="wating">Loading......</span>
                        <li v-if="article" class="article">
                            <p class="a-title">{{ article['title'] }}</p>
                            <p class="a-author">{{ article['author'] }}</p>
                            <p class="a-date">{{ timetrans(article['timestamp']) }}</p>
                            <div class="a-content" v-html="article['content']"></div>
                            <p class="a-count">共 {{ article['viewcount'] }} 次浏览</p>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </template>
    <!-- 自定义脚本 -->
    <script src="/static/javascript/base/base.js"></script>
</body>
{% endraw %}

</html>